package indi.woniu.mapper;

import indi.woniu.entity.Answer;
import indi.woniu.entity.Question;
import indi.woniu.entity.QuestionDTO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface IssueMapper {
    Integer addOne(QuestionDTO questionDTO);

    Integer delOne(int id);

    List<QuestionDTO> findByCondition(QuestionDTO question);

    int findBySubject(String subject);

    List<Integer> findByFid(int subject_id);

    List<QuestionDTO> findByPids(@Param("pids") List pids,@Param("issue") QuestionDTO questionDTO);

    int findByFidAndName(@Param("fid") int fid,@Param("name") String poolName);

    List<Integer> findByPoolName(String poolName);

    List<Integer> findBySubjectAndGrade(@Param("subject") String poolName,@Param("grade") String poolName1);

    void addPoolAndIssueId(@Param("qid") int id,@Param("pid") int pid);

    Integer delPoolAndIssueId(int id);

    void addAnswer(Answer answer);

    void delAnswer(int id);

    List<QuestionDTO> findAll();

    List<Integer> findByGrade(String poolName);

    List<String> findByIssueId(int id);

    QuestionDTO findInfoByIssueId(int id);
}
